package io.renren.modules.finance.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.renren.modules.finance.entity.FinanceMoneyRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 收益账户变动明细表
 *
 * @author meishou
 * @date 2019-05-02 14:36:34
 */
@Mapper
public interface FinanceMoneyRecordDao extends BaseMapper<FinanceMoneyRecord> {

    List<FinanceMoneyRecord> queryPage(@Param("page") IPage page, @Param("params") Map<String, Object> params);

    /**
     * 查询APP列表
     *
     * @param page
     * @param params
     * @return
     */
    IPage<FinanceMoneyRecord> queryAppPage(@Param("page") IPage page, @Param("params") Map<String, Object> params);

    /**
     * 查询单个代理的收入余额收支合计
     *
     * @param agentId
     * @return
     */
    List<FinanceMoneyRecord> inAndOut(@Param("agentId") Integer agentId);

    LinkedHashMap<String, Object> getIncomeDayStatistics();

    LinkedHashMap<String, Object> getIncomeWeekStatistics();

    LinkedHashMap<String, Object> getIncomeMonthStatistics();

    LinkedHashMap<String, Object> getIncomeYearStatistics();

    BigDecimal getYesterdayIncome();

    BigDecimal getBeforeWeekIncome();

    BigDecimal getBeforeMonthIncome();

    BigDecimal getBeforeYearIncome();

    List<FinanceMoneyRecord> testOutInAndOutTotal();
}
